<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>css | 学习笔记</title><meta name="author" content="lzoxun"><meta name="copyright" content="lzoxun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="CSS   层叠样式表 , 给标签添加样式  内联样式 内部样式 link href 外部样式 选择器 布局 定位 文档流 伪类 伪元素  单位 继承 盒子模型 图标 字体图标 官方文档   MDN文档  兼容性 外部样式12&#x2F;* link href 引入到 html*&#x2F;@import url(&quot;xxxx.css&quot;); &#x2F;*css 文件 引入其他样式文件*&#x2F;    CSS 属性">
<meta property="og:type" content="article">
<meta property="og:title" content="css">
<meta property="og:url" content="http://example.com/2023/07/22/web/web-css/index.html">
<meta property="og:site_name" content="学习笔记">
<meta property="og:description" content="CSS   层叠样式表 , 给标签添加样式  内联样式 内部样式 link href 外部样式 选择器 布局 定位 文档流 伪类 伪元素  单位 继承 盒子模型 图标 字体图标 官方文档   MDN文档  兼容性 外部样式12&#x2F;* link href 引入到 html*&#x2F;@import url(&quot;xxxx.css&quot;); &#x2F;*css 文件 引入其他样式文件*&#x2F;    CSS 属性">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:published_time" content="2023-07-22T07:14:09.698Z">
<meta property="article:modified_time" content="2023-07-22T07:14:09.698Z">
<meta property="article:author" content="lzoxun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://example.com/2023/07/22/web/web-css/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'css',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-07-22 15:14:09'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="学习笔记"><span class="site-name">学习笔记</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">css</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-07-22T07:14:09.698Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-07-22T07:14:09.698Z" title="更新于 2023-07-22 15:14:09">2023-07-22</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="css"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h3 id="CSS"><a href="#CSS" class="headerlink" title="CSS"></a>CSS</h3><blockquote>
<p>  层叠样式表 , 给标签添加样式</p>
</blockquote>
<p><code>内联样式</code> <code>内部样式</code> <code>link href 外部样式</code> <code>选择器</code> <code>布局</code> <code>定位</code> <code>文档流</code> <code>伪类</code> <code>伪元素</code>  <code>单位</code> <code>继承</code> <code>盒子模型</code> <code>图标 字体图标</code></p>
<p><a target="_blank" rel="noopener" href="https://www.w3.org/TR/?tag=css">官方文档</a>   <a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/CSS">MDN文档</a>  <a target="_blank" rel="noopener" href="https://caniuse.com/">兼容性</a></p>
<h4 id="外部样式"><a href="#外部样式" class="headerlink" title="外部样式"></a>外部样式</h4><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* link href 引入到 html*/</span></span><br><span class="line"><span class="keyword">@import</span> url(<span class="string">&quot;xxxx.css&quot;</span>); <span class="comment">/*css 文件 引入其他样式文件*/</span></span><br></pre></td></tr></table></figure>



<h3 id="CSS-属性"><a href="#CSS-属性" class="headerlink" title="CSS 属性"></a>CSS 属性</h3><h4 id="一些属性"><a href="#一些属性" class="headerlink" title="一些属性"></a>一些属性</h4><ol>
<li><p>定位(position) 和布局(Layout)</p>
</li>
<li><p>展示(display:none 不占位置)和可见(Visivbility:none 任占据位置)</p>
</li>
<li><p>盒子模型</p>
</li>
<li><p>背景设置</p>
<ol>
<li>颜色的表示方法 （red 、#f00、 RGB(255,0,0)、RGBA）</li>
<li><code>background-color</code> 设置背景色 ,  <code>color</code>设置的是前景色，下划线删除线的颜色也会改变</li>
</ol>
</li>
<li><p>字体、文本</p>
<ol>
<li><p><code>text-decoration</code> 装饰线</p>
</li>
<li><p><code>text-align</code> 设置 <code>行内元素或内容</code>相对 <code>块父元素的</code> 水平对齐方式，块元素居中需要 <code>margin 0 auto</code></p>
<ol>
<li><code>justify</code> 两端对齐，中间平均分配 (最后一行不生效, 一段文字如果最后一行只有两个词，一个做一个右不好看)</li>
<li><code>text-align-last:justify</code> 这样最后一行就能生效了</li>
<li><code>letter-spacing   word-spacing</code>  字母或单词间距</li>
</ol>
</li>
<li><p>单位</p>
<ol>
<li>px</li>
<li>em<ol>
<li>相对<code>父元素字体大小</code>的倍数</li>
<li>或者说<code>通过继承</code>得到一个<code>默认大小</code>，<code>em 相对自己字体大小</code> 的倍数进行设置</li>
</ol>
</li>
<li>百分比%<ol>
<li>不同地方用百分比相对的东西都是不同的，比较混乱</li>
<li><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/CSS/font-size">MDN</a>  找搜索 font-size 到 <code>Percentages (百分比)</code> 查询 得到 <code>refer to the parent element&#39;s font size</code><ol>
<li>font-size - 父级字体大小  ，width - 父级容器宽度 ，padding，margin - 父级容器宽度</li>
</ol>
</li>
</ol>
</li>
<li>rem</li>
<li>vw&#x2F;vh</li>
<li>小程序 rpx</li>
</ol>
</li>
<li><p>font-family</p>
<ol>
<li>尽量设置多个，防止用户系统找不到相应字体而用 不可控的默认字体</li>
</ol>
</li>
<li><p>line-height</p>
<ol>
<li><p>设置一行文本所占用的高度，准确说是 <code>两行文本基线(baseline)之间的距离</code></p>
<p><img src= "" data-lazy-src="/../../static/img/2022-09-04_075115.jpg"></p>
</li>
<li><p>系统会将<code>行高大小 - 文字大小</code> ，剩下的<code>行距</code>  上面一半下面一半，可以起到居中的作用</p>
</li>
<li><p>为什么行高与文字大小相等，上下还是会有一点距离  (可能因为 <code>font-size 设置顶线到底线</code>的距离，里面的<code>字距离顶线与底线</code>距离总是有一点距离的)</p>
</li>
</ol>
</li>
<li><p>font-weight</p>
<ol>
<li>w3c  100 ~ 900</li>
<li>400 <code>默认</code></li>
<li>700 <code>bold</code></li>
<li>1 ，100.6 ，123， 1000  也可以</li>
</ol>
</li>
<li><p>font-style</p>
<ol>
<li>italic : 适用字体中设计方案中自带的斜体，不支持的就没用</li>
<li>oblique: 让文本进行倾斜</li>
</ol>
</li>
<li><p>font-variant: small-caps   将小写字母显示成<code>缩小的大写字母</code></p>
</li>
<li><p>font 缩写 <code>font:style weight variant size/line-height family;</code></p>
<ol>
<li>style weight variant 位置不限制,可以省略</li>
<li>line-height，位置必须在size 后面，也可以省略，不写单位代表前面的倍数</li>
<li>size family 位置在最后不能变，也不能省略</li>
</ol>
</li>
</ol>
</li>
<li><p>其他属性</p>
</li>
</ol>
<h4 id="属性的特性"><a href="#属性的特性" class="headerlink" title="属性的特性"></a>属性的特性</h4><ol>
<li>属性的继承<ol>
<li>默认继承<ol>
<li>某元素设置<code>具备继承性的属性</code>，那么它的<code>所有后代元素</code>都<code>默认拥有该属性</code>，后代重新设置优先级高<code>可以覆盖</code></li>
</ol>
</li>
<li>常见可继承的属性<ol>
<li><code>font-size</code> font-family font-weight line-height color text-align …</li>
<li>一般<code>文本相关</code>属性默认可继承</li>
<li>通过Google控制台，<code>Style -&gt; Inherited from xxx</code> 可以指定某些属性是否可继承</li>
</ol>
</li>
<li>继承的注意事项<ol>
<li>继承的是计算后的值，不一定是设置时手写上去那些字符；<code>font-size:2em  -&gt; 继承后 font-size:32px</code></li>
</ol>
</li>
<li>强制继承<ol>
<li>子元素 <code>border:inherit</code> 强制继承父元素的 border</li>
</ol>
</li>
</ol>
</li>
<li>层叠，<ol>
<li>对于<code>同一个</code>操作对象，它的样式可以通过<code>任何样式表</code>或<code>不同选择器</code>进行设置，最终<code>通过优先级</code>，拿到<code>优先级最高的设置</code></li>
<li>优先级: <code>!important&#123;1000&#125; &gt; 内联样式&#123;1000&#125; &gt; ID&#123;100&#125; &gt; Class|伪类|属性 &#123;10&#125; &gt; 元素|伪元素 &#123;1&#125; &gt; * &#123;0&#125;</code></li>
<li>权重可以累加 <code>p.xxx &#123;11&#125; &gt; .xxx&#123;10&#125;</code></li>
</ol>
</li>
</ol>
<h3 id="块元素的盒子模型"><a href="#块元素的盒子模型" class="headerlink" title="块元素的盒子模型"></a>块元素的盒子模型</h3><ul>
<li>块级元素<ul>
<li>单独占据一整行</li>
<li>设置宽度后，块元素仍然占据一整行，浏览器将默认的margin-right:auto 设置成认为是剩下所有</li>
</ul>
</li>
<li>普通行内元素<ul>
<li>宽高只有内容决定 ，无法通过宽高设置</li>
</ul>
</li>
<li>行内替换元素( inline-replaces )   ,并不是行内块(display:inline-block)元素<ul>
<li>不占据一整，但是可以设置宽高</li>
<li>img 、video 、input</li>
</ul>
</li>
<li>注意事项<ul>
<li>display 改变元素类型</li>
<li>行内元素里面不要放块元素</li>
<li>一般情况块可以包含任何元素，但是<code>p元素</code>不能包含其他块元素 (不会报错，但是浏览器解析处理，会单独创建多个p元素处理)</li>
</ul>
</li>
<li><code>内容 Content</code> <code>内边距 padding</code> <code>边框 border</code> <code>外边距 margin</code><ul>
<li><p><strong>margin传递</strong> : 如果<code>块元素顶部</code>和<code>父级顶部线</code>重叠，那么子元素设置的 m-t 会变成父元素的 m-t（除非父自己也设了，并且更大）</p>
<ul>
<li>1、<code>父元素</code>设置<code>边框</code>可以解决</li>
<li>2、触发父级盒子 <code>BFC</code></li>
<li>3、这种需求最好不要用子元素margin (设置兄弟之间的距离)，应该用父元素padding (设置父子之间的距离)</li>
<li>4、父元素 height:auto; 的话，margin-bottom 也会传递</li>
</ul>
</li>
<li><p><strong>margin折叠</strong></p>
<ul>
<li>上下两个盒子，上下<code>都设置margin</code>，浏览器<code>会取更大的那个</code>，左右margin不会，上下才会折叠</li>
</ul>
</li>
<li><p><strong>margin:0 auto</strong> 可以居中的原因</p>
<ul>
<li>块元素的宽度 &#x3D; <code>width + padding + border + margin</code> </li>
<li>块元素一定占据整行，设置宽度后，剩下的会<code>分配给margin-right值</code> (没设置时，默认margin是0的)</li>
<li>当 <code>margin-left</code> 和 <code>margin-right</code>  都为 auto 时，浏览器会<code>自动分配剩余</code>的部分，就居中了，只能水平居中</li>
</ul>
</li>
<li><p>这些不适合用于行内非替换元素，会有很多奇怪的问题</p>
<ul>
<li>比如给 span 设置padding，只要左右和下面有效果，并且<code>左右占据空间</code>，下面是<code>不占据空间</code>的</li>
<li>比如给span 设置margiin，左右生效，上下不生效</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="其他属性"><a href="#其他属性" class="headerlink" title="其他属性"></a>其他属性</h3><ul>
<li><p><code>外轮廓 outline</code></p>
<ul>
<li>语法和border一样 ，默认显示 boder 外面，<code>但不占据空间</code></li>
</ul>
</li>
<li><p><code>盒子阴影 box-shadow</code></p>
<ul>
<li>X偏移值 Y偏移值 模糊 扩散? 颜色 inset内阴影, xxx 阴影2</li>
</ul>
</li>
<li><p><code>文字阴影 text-shadow</code></p>
<ul>
<li>没有扩散</li>
</ul>
</li>
<li><p><code>文本属性</code></p>
<ul>
<li>单行省略<ul>
<li><code>white-space:nowrap</code> 强制不换行，<code>overflow:hidden</code> 隐藏超出，·<code>text-overflow:ellipsis</code> 文本超出则涉略号显示</li>
<li>flex:1 的容器中会有问题</li>
</ul>
</li>
</ul>
</li>
<li><p><code>设置背景</code></p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* */</span></span><br><span class="line"><span class="attribute">background-color</span>:<span class="number">#f00</span>;</span><br><span class="line"><span class="comment">/* */</span></span><br><span class="line"><span class="attribute">background-image</span>:<span class="built_in">url</span>(<span class="string">a.jpg</span>),<span class="built_in">url</span>(<span class="string">2.jpg</span>);</span><br><span class="line"><span class="comment">/* 平铺 */</span></span><br><span class="line"><span class="attribute">background-repeat</span>:no-repeat;</span><br><span class="line"><span class="comment">/* 尺寸 cover 缩放 铺满 保持比例裁剪 ，contain 缩放 宽或者高铺满 保持比例 无需裁剪*/</span></span><br><span class="line"><span class="attribute">background-size</span>:auto|cover|contain|<span class="number">100%</span> <span class="number">100%</span>|<span class="number">100px</span> <span class="number">100px</span>:</span><br><span class="line"><span class="comment">/* 背景位置 */</span></span><br><span class="line">background-position:<span class="number">100px</span> -<span class="number">100px</span>|top left|top <span class="string">&quot;不设置bottom默认永远保持居中&quot;</span>;</span><br><span class="line"><span class="comment">/* 滚动 默认scroll不滚动，local跟随容器滚动，fixed相对浏览器窗口固定，滚动页面，容器向上，背景却停留原来位置*/</span></span><br><span class="line"><span class="attribute">background-attachment</span>:scroll|local|fixed;</span><br><span class="line"><span class="comment">/* background */</span></span><br><span class="line"><span class="attribute">background</span>:color url 定位/尺寸 repeat local;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 对比img */</span></span><br><span class="line"><span class="selector-tag">img</span> 是一个元素 占用空间 右键可看地址 不支持精灵图(CSS Sprite) 对搜索引擎友好</span><br><span class="line"><span class="attribute">background</span> 相反</span><br><span class="line"></span><br><span class="line">图片作为网站重要组成部分，像logo，产品图等最好用<span class="selector-tag">img</span></span><br><span class="line">修饰美观的部分可以用 <span class="attribute">background</span></span><br></pre></td></tr></table></figure></li>
</ul>
<h3 id="选择器"><a href="#选择器" class="headerlink" title="选择器"></a>选择器</h3><h3 id="图标"><a href="#图标" class="headerlink" title="图标"></a>图标</h3><h4 id="边框图标"><a href="#边框图标" class="headerlink" title="边框图标"></a>边框图标</h4><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">box-sizing</span>:border-box; <span class="comment">/* 设置主内容包括边框 ，放大边框可以挤掉所有盒子的位置*/</span></span><br><span class="line"><span class="comment">/* 三个边框 color 设置 transparent 透明，产生三角图标 */</span></span><br><span class="line"><span class="comment">/* https://css-tricks.com/the-shapes-of-css/#top-of-site*/</span></span><br></pre></td></tr></table></figure>



<h4 id="字体图标"><a href="#字体图标" class="headerlink" title="字体图标"></a>字体图标</h4><ol>
<li><p>font-family:””; 使用的字体，默认是系统中储存的字体 </p>
</li>
<li><p>自定义网络字体</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 引用字体 */</span></span><br><span class="line"><span class="keyword">@font-face</span>&#123; </span><br><span class="line">  <span class="attribute">font-family</span>:YH;</span><br><span class="line">  <span class="attribute">src</span>:<span class="built_in">url</span>(<span class="string">http://domain/fonts/MSYH.TTF</span>); <span class="comment">/* 一般回下载到本地 */</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">@font-face</span>&#123; </span><br><span class="line">  <span class="attribute">font-family</span>:YH;</span><br><span class="line">  <span class="attribute">src</span>:<span class="built_in">url</span>(<span class="string">&quot;./fonts/xxx.eot&quot;</span>); <span class="comment">/* 专门为了兼容IE */</span></span><br><span class="line">  <span class="attribute">src</span>:<span class="built_in">url</span>(<span class="string">&quot;./fonts/xxx.eot?#iefix&quot;</span><span class="string"> format(&quot;embedded-opentype&quot;</span>)), <span class="comment">/* format 帮助浏览器快速识别字体 */</span></span><br><span class="line">      <span class="built_in">url</span>(<span class="string">&quot;./fonts/xxx.woff&quot;</span><span class="string"> format(&quot;woff&quot;</span>)),</span><br><span class="line">      <span class="built_in">url</span>(<span class="string">&quot;./fonts/xxx.ttf&quot;</span><span class="string"> format(&quot;truetype&quot;</span>)),</span><br><span class="line">      <span class="built_in">url</span>(<span class="string">&quot;./fonts/xxx.svg&quot;</span><span class="string"> format(&quot;svg&quot;</span>)),</span><br><span class="line">   ;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 普通使用字体 */</span></span><br><span class="line"><span class="selector-tag">html</span>&#123;</span><br><span class="line">    <span class="attribute">font-family</span>:<span class="string">&quot;YH&quot;</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">/* 字体可以说设置成各种形状，所有也能设置成图标的样子 https://www.iconfont.cn */</span></span><br><span class="line"><span class="selector-class">.iconfont</span> &#123; <span class="comment">/* 希望使用字体图标的地方 必须用有类 iconfont ，*/</span></span><br><span class="line">    <span class="attribute">font-family</span>:<span class="string">&quot;YH&quot;</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-tag">i</span> class=&#x27;iconfont icotype&#x27;  编码 /<span class="selector-tag">i</span></span><br><span class="line"><span class="comment">/* 也可以写到样式中, 通过给 icotype 就能直接使用某个图标了*/</span></span><br><span class="line"><span class="selector-class">.icotype</span><span class="selector-pseudo">::before</span>&#123;</span><br><span class="line">    <span class="attribute">content</span>:<span class="string">&quot;编码&quot;</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">/* 兼容处理 */</span></span><br><span class="line">OpenType/TrueType 类字体扩展名 <span class="selector-class">.ttf</span> <span class="selector-class">.otf</span>  （两个兼容性好 除了ie8）</span><br><span class="line">Embedded OpenType 类字体扩展名 <span class="selector-class">.eot</span>  (仅仅IE支持)</span><br><span class="line">SVG字体 扩展名 <span class="selector-class">.svg</span> <span class="selector-class">.svgz</span> (主要适配苹果那个浏览器)</span><br><span class="line">WOFF 开放字体扩展名 <span class="selector-class">.woff</span> （兼容性好 除了ie8）  <span class="selector-class">.woff2</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* https://www.fonts.net.cn/  有包括有版权的 免费的多种字体 */</span></span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="精灵图-CSS-Sprite"><a href="#精灵图-CSS-Sprite" class="headerlink" title="精灵图 CSS Sprite"></a>精灵图 CSS Sprite</h4><blockquote>
<p>  是一种<code>CSS图形合成技术</code>，将各种小图片合并到一个图片上，利用CSS背景定位来显示对应图片部分，<code>CSS雪碧</code>或<code>CSS精灵</code></p>
</blockquote>
<p>优点</p>
<ol>
<li>减少请求数量，加快响应速度，减轻压力，优化性能</li>
<li>减少图片总大小</li>
<li>解决图片命名困扰</li>
</ol>
<p>制作</p>
<ol>
<li>设计人员提供</li>
<li><a target="_blank" rel="noopener" href="https://www.toptal.com/developers/css/sprite-generator">https://www.toptal.com/developers/css/sprite-generator</a>  工具网站</li>
</ol>
<p>使用</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"> <span class="comment">/* http://www.spritecow.com/ 获取设计稿图片信息 */</span></span><br><span class="line"> </span><br><span class="line"><span class="attribute">background-position</span>:<span class="number">10px</span> <span class="number">10px</span>; <span class="comment">/* 通过这种方式将已近引入的雪碧背景图片，定位到合适的位置 */</span></span><br></pre></td></tr></table></figure>



<h3 id="布局"><a href="#布局" class="headerlink" title="布局"></a>布局</h3><h4 id="标准流（Normal-Flow）"><a href="#标准流（Normal-Flow）" class="headerlink" title="标准流（Normal Flow）"></a>标准流（Normal Flow）</h4><ul>
<li>默认元素<code>从左到右</code> <code>从上到下</code> ，块独占一行，这样 按顺序排布</li>
<li>默认相互之间不存在重叠现象</li>
</ul>
<h4 id="定位流"><a href="#定位流" class="headerlink" title="定位流"></a>定位流</h4><blockquote>
<p>  通过 position 将元素脱离标准流，单独对其设置位置，使它们有不同行为</p>
</blockquote>
<ul>
<li><p>如: 放到另一个元素上面，或始终保存在浏览器窗口的同一个位置</p>
</li>
<li><p>position 元素</p>
<ul>
<li><p>static 默认</p>
</li>
<li><p>relative 相对定位</p>
<ul>
<li>元素<code>依然</code>按标准流布局，但是可以使用 left top 等属性调整位置，<code>并且不影响标准流其他元素</code></li>
<li>移动的标准是<code>父元素</code></li>
<li>常用与元素位置的<code>微调</code></li>
</ul>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 让img始终保持居中 */</span></span><br><span class="line"><span class="selector-class">.box</span> <span class="selector-tag">img</span>&#123;</span><br><span class="line">    <span class="attribute">position</span>:relative;</span><br><span class="line">    <span class="attribute">left</span>:-<span class="number">960px</span>; <span class="comment">/* 如果图片宽度为1920的话 , transform:translate(-50%)不要算宽度 */</span></span><br><span class="line">    <span class="attribute">margin-left</span>:<span class="number">50%</span>; <span class="comment">/* margin 的% 始终是相对父元素宽度的 */</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>absolute 绝对定位</p>
<ul>
<li>直接脱离标准流   </li>
<li>移动的标准是相对 <code>定位了的</code>祖先元素，或<code>浏览器画布</code>进行移动，不是body</li>
<li>定位元素的特点<ul>
<li>所有元素可以设置宽高</li>
<li>宽高默认由内容决定</li>
<li>不会支撑父元素的高度</li>
</ul>
</li>
<li>相对定义的祖先元素宽度 &#x3D; 绝对定位元素宽度 + left + right + marginLeft + marginRight;</li>
<li><pre><code> relative 宽度   800 ，不设置 absolute  元素宽度
</code></pre>
<ul>
<li>800 &#x3D; auto width + 0 + 0 + 0 + 0； 默认宽度，auto 所有会是800；</li>
<li>800 &#x3D; auto width + 50 + 50 + 0 + 0 ；那么定位元素宽度会自适应，宽度永远距离相对父级50像素</li>
</ul>
</li>
<li>relative 宽度   800 ，设置 absolute  元素宽度<ul>
<li>800 &#x3D; 200 + 0 + 0 + auto + auto; 局可以实现水平居中了，浏览器不会吧left right的auto看成居中</li>
</ul>
</li>
<li>上面公式 也适用于垂直方向</li>
<li></li>
</ul>
</li>
<li><p>fixed 固定定位</p>
<ul>
<li>直接脱离标准流</li>
<li>相对<code>可视区域</code> 定位<ul>
<li><code>视口</code>只有可以看到的一屏幕，<code>画布</code>包括滚动的区域 &gt;&#x3D; 视口</li>
</ul>
</li>
</ul>
</li>
<li><p><code>sticky</code> 粘性定位 （新）</p>
<ul>
<li><strong>相对定位</strong>和<strong>固定定位</strong>的结合体</li>
<li>默认是相对定位，当<strong>滚动到指定位置时</strong>，变成固定定位</li>
<li>相对于最近的能滚动的视口</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">以前实现</span></span><br><span class="line">首先设置成 相对定位，浏览器滚动到指定位置时，拿到元素，包absolute 该成固定定位</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">使用 sticky</span></span><br><span class="line">.box&#123;</span><br><span class="line">	position: sticky;</span><br><span class="line">	top:0; # 距离最近的能滚动的视口顶部 0像素 时，在该视口位置固定</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>
</li>
<li><p>定位后能用的属性</p>
<ul>
<li><p><code>left</code> <code>top</code> <code>buttom</code> <code>right</code> <code>z-index</code> </p>
<ul>
<li>z-index  兄弟元素中值越大，层级越高， 非兄弟元素，找它们最近的，同级设置了zindex的祖先进行比较</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="浮动"><a href="#浮动" class="headerlink" title="浮动"></a>浮动</h4><h3 id="全局变量"><a href="#全局变量" class="headerlink" title="全局变量"></a>全局变量</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 如果用 css 定义全局变量，比起scss的优势 不需要一直导入 */</span></span><br><span class="line"><span class="comment">/* 使用 color:var(--main-bg); */</span></span><br><span class="line"><span class="selector-pseudo">:root</span> &#123;</span><br><span class="line">    <span class="attr">--main-bg</span>: <span class="number">#07C160</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>











</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://example.com">lzoxun</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2023/07/22/web/web-css/">http://example.com/2023/07/22/web/web-css/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">学习笔记</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/07/22/web/web-diskapp-electron/" title="electron"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">electron</div></div></a></div><div class="next-post pull-right"><a href="/2023/07/22/web/web-html/" title="html"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">html</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">lzoxun</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/liaozhongxun"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/liaozhongxun" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:869664233@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">这是我的文档</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#CSS"><span class="toc-number">1.</span> <span class="toc-text">CSS</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%A4%96%E9%83%A8%E6%A0%B7%E5%BC%8F"><span class="toc-number">1.1.</span> <span class="toc-text">外部样式</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#CSS-%E5%B1%9E%E6%80%A7"><span class="toc-number">2.</span> <span class="toc-text">CSS 属性</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%80%E4%BA%9B%E5%B1%9E%E6%80%A7"><span class="toc-number">2.1.</span> <span class="toc-text">一些属性</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%B1%9E%E6%80%A7%E7%9A%84%E7%89%B9%E6%80%A7"><span class="toc-number">2.2.</span> <span class="toc-text">属性的特性</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9D%97%E5%85%83%E7%B4%A0%E7%9A%84%E7%9B%92%E5%AD%90%E6%A8%A1%E5%9E%8B"><span class="toc-number">3.</span> <span class="toc-text">块元素的盒子模型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%B6%E4%BB%96%E5%B1%9E%E6%80%A7"><span class="toc-number">4.</span> <span class="toc-text">其他属性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%80%89%E6%8B%A9%E5%99%A8"><span class="toc-number">5.</span> <span class="toc-text">选择器</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9B%BE%E6%A0%87"><span class="toc-number">6.</span> <span class="toc-text">图标</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BE%B9%E6%A1%86%E5%9B%BE%E6%A0%87"><span class="toc-number">6.1.</span> <span class="toc-text">边框图标</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87"><span class="toc-number">6.2.</span> <span class="toc-text">字体图标</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%B2%BE%E7%81%B5%E5%9B%BE-CSS-Sprite"><span class="toc-number">6.3.</span> <span class="toc-text">精灵图 CSS Sprite</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B8%83%E5%B1%80"><span class="toc-number">7.</span> <span class="toc-text">布局</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%A0%87%E5%87%86%E6%B5%81%EF%BC%88Normal-Flow%EF%BC%89"><span class="toc-number">7.1.</span> <span class="toc-text">标准流（Normal Flow）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%9A%E4%BD%8D%E6%B5%81"><span class="toc-number">7.2.</span> <span class="toc-text">定位流</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%B5%AE%E5%8A%A8"><span class="toc-number">7.3.</span> <span class="toc-text">浮动</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F"><span class="toc-number">8.</span> <span class="toc-text">全局变量</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-11/" title="win 11 set">win 11 set</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-gitbash/" title="git bash">git bash</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-wsl/" title="wsl">wsl</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-main/" title="window">window</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/web/%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98/" title="兼容问题">兼容问题</a><time datetime="2023-07-22T07:14:09.699Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By lzoxun</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div class="no-result" id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/haruto.model.json"},"display":{"position":"right","width":100,"height":200,"right":300},"mobile":{"show":true}});</script></body></html>